package com.example.expandablelistview.menu;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;

import com.example.expandablelistview.R;

public class MenuChange extends Activity {
    boolean mBeginner = true;
	
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.changemenu);
    }
	
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        MenuInflater inflater = getMenuInflater();
        if (mBeginner){
            inflater.inflate(R.menu.beginner, menu);
        }else{
            inflater.inflate(R.menu.professional, menu);
        }
        return true;
    }
	
    public void mOnClick(View v){
        switch(v.getId()){
        case R.id.changemenu_beginner_btn:
            mBeginner = true;
            invalidateOptionsMenu();
            break;
        case R.id.changemenu_professional_btn:
            mBeginner = false;
            invalidateOptionsMenu();
            break;
        }
    }

}
